<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://struts.apache.org/tags-html-el" prefix="html-el" %>
<%@taglib uri="http://struts.apache.org/tags-bean-el" prefix="bean-el" %>
<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@taglib uri="http://struts.apache.org/tags-logic-el" prefix="logic-el" %>
<%@taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@taglib uri="/WEB-INF/tld/application.tld" prefix="app" %>

<style type="text/css">
	.swfupload {
		position: absolute;
		z-index: 1;
	}
</style>

<html-el:form action="/matricularAluno.do">
	<html-el:hidden property="method" styleId="method"/>
	<table style="width: 100%">
		<tr>
			<td align="center" valign="top">
				<!-- CONTENT -->			
				<div class="content">
					<table class="con">
						<tr>
							<td>
								<table class="breadory">
									<tr>
										<td>Consultar Aluno - ${aluno.nome} - ${aluno.cpf}</td> 
									</tr>
								</table>
								<br>
								<div style="width: 950px; height: 580px"> 
								    <div data-dojo-type="dijit.layout.TabContainer" style="width: 100%; height: 100%;" id="tabContainer">
								        <div data-dojo-type="dijit.layout.ContentPane" title="Aluno" selected="true" id="tabAluno">

											<table style="width:100%">
												<tr>
													<td valign="top">
														<table class="formulario" border="0">
															<tr>
																<td colspan="5">
																	<table class="breadorySub" style="width:300px">
																		<tr>
																			<td>1. Dados Gerais</td>
																		</tr>
																	</table>
																</td>
															</tr>
															<tr>
																<td class="required">CPF:</td>
																<td class="inputField" style="padding-left:7px"><input type="text" id="cpf" title="CPF" size="12" maxlength="14" value="${aluno.cpf}" disabled="disabled"/></td>
															</tr>
															<tr>
																<td class="required">Nome:</td>
																<td class="inputField" style="padding-left:7px">
																	<input type="text" id="nome" title="Nome" size="50" maxlength="50" disabled="disabled"/>
																</td>
																<td style="width: 20px"></td>
																<td class="required">Data Nascimento:</td>
																<td class="inputField">
																	<input type="text"
																	style="font-size:14px;width:130px"
																	name="dataNascimento" id="dataNascimento" value="" disabled="disabled"
																	title="Data do Nascimento" constraints="{datePattern:'dd/MM/yyyy', strict:true}"
																	data-dojo-type="dijit.form.DateTextBox"	data-dojo-props="required:true, invalidMessage:'Data Inválida!'" />
																</td>
															</tr>
															<tr>
																<td class="required">RG:</td>
																<td colspan="8">
																	<table class="formulario" cellpadding="0" cellspacing="0">
																		<tr>
																			<td class="inputField">
																				<input type="text" id="rg" title="RG" size="12" maxlength="12" disabled="disabled"/>
																			</td>
																			<td style="width: 20px"></td>												
																			<td class="required">Orgão Exp:</td>
																			<td class="inputField">
																				<input type="text" id="orgaoExpeditor" title="Orgão Expeditor" size="6" maxlength="6" disabled="disabled"/>
																			</td>
																			<td style="width: 20px"></td>												
																			<td class="required">Sexo:</td>
																			<td class="inputField">
																				<app:comboSexo styleId="sexo" title="Sexo" disabled="true"/>
																			</td>
																			<td style="width: 20px"></td>
																			<td class="required">Deficiente:</td>
																			<td class="inputField">
																				<app:comboSimNao styleId="deficiente" title="Deficiente" disabled="true" selected="NAO"/>
																			</td>
																		</tr>
																	</table>
																</td>
															</tr>
														</table>
														<br>
														<table class="formulario">
															<tr>
																<td colspan="5">
																	<table class="breadorySub" style="width:300px">
																		<tr>
																			<td>2. Dados da CNH</td>
																		</tr>
																	</table>
																</td>
															</tr>
															<tr>
																<td colspan="8">
																	<table class="formulario">
																		<tr>
																			<td class="label">Registro/PGU:</td>
																			<td class="inputField">
																				<input type="text" id="pgu" title="Registro/PGU" size="10" disabled="disabled" maxlength="11"/>
																			</td>
																			<td style="width: 20px"></td>
																			<td class="label">Categoria:</td>
																			<td class="inputField">
																				<app:comboCategoriaCnh styleId="categoria" title="Categoria CNH" disabled="true" style="width:110px"/>
																			</td>
																			<td style="width: 20px"></td>
																			<td class="label">Data Primeira Habilitação:</td>
																			<td class="inputField">
																				<input type="text"
																				style="font-size:14px;width:130px" 
																				id="dataPrimeiraHabilitacao" value="" disabled="disabled"
																				title="Data da Primeira Habilitação" constraints="{datePattern:'dd/MM/yyyy', strict:true}"
																				data-dojo-type="dijit.form.DateTextBox"	data-dojo-props="required:true, invalidMessage:'Data Inválida!'" />
																			</td>
																		</tr>
																	</table>
																</td>
															</tr>
														</table>
														<table class="formulario">
															<tr>
																<td colspan="8"><br>
																	<table class="breadorySub" style="width:300px">
																		<tr>
																			<td>3. Localização</td>
																		</tr>
																	</table>
																</td>
															</tr>
															<tr>
																<td class="required">CEP:</td> 
																<td class="inputField">
																	<input type="text" id="cep" title="CEP" size="5" maxlength="9" disabled="disabled" onblur="consultaCep(this)"/> 
																</td>
															</tr>
															<tr>
																<td class="required">Endereço:</td>
																<td class="inputField">
																	<input type="text" id="endereco" title="Endereço" size="35" maxlength="50" disabled="disabled"/>
																</td>
																<td style="width: 20px"></td>
																<td class="required">Número:</td>
																<td class="inputField">
																	<input type="text" id="numero" title="Número" size="3" maxlength="5" disabled="disabled"/>
																</td>
																<td style="width: 20px"></td>
																<td class="label">Compl.:</td>
																<td class="inputField">
																	<input type="text" id="complemento" title="Complemento" size="3" maxlength="5" disabled="disabled"/>
																</td>
															</tr>
															<tr>
																<td class="required">Bairro:</td>
																<td class="inputField">
																	<input type="text" id="bairro" title="Bairro" size="20" maxlength="50" disabled="disabled"/>
																</td>
																<td style="width: 20px"></td>
																<td class="required">Cidade:</td>
																<td class="inputField">
																	<input type="text" id="cidade" title="Cidade" size="15" maxlength="50" value="" disabled="disabled"/>
																</td>
																<td style="width: 20px"></td>
																<td class="required">UF:</td>
																<td class="inputField">
																	<app:comboUF styleId="uf" title="UF" disabled="true" selected="SP" style="width:110px"/>
																</td>
															</tr>
														</table>
														<table class="formulario">
															<tr>
																<td colspan="8"><br>
																	<table class="breadorySub" style="width:300px">
																		<tr>
																			<td>4. Contato</td>
																		</tr>
																	</table>
																</td>
															</tr>
															<tr>
																<td class="label">Telefone:</td>
																<td class="inputField">
																	<input type="text" id="telefone" title="Telefone" size="8" disabled="disabled" style="width:120px"/>
																</td>
																<td style="width: 20px"></td>
																<td class="label">Celular:</td>
																<td class="inputField">
																	<input type="text" id="celular" title="Celular" size="8" disabled="disabled" style="width:120px"/>
																</td>
																<td style="width: 20px"></td>
																<td class="label">Comercial:</td>
																<td class="inputField">
																	<input type="text" id="comercial" title="Comercial" size="8" disabled="disabled" style="width:120px"/>
																</td>
															</tr>
															<tr>
																<td class="label">Email:</td>
																<td class="inputField" colspan="6">
																	<input type="text" id="email" title="Email" size="55" disabled="disabled" maxlength="50"/>
																</td>
															</tr>
														</table>
													</td>
												</tr>
												<tr>
													<td class="buttons" align="right" valign="bottom">	
														<a href="javascript:return" onclick="manterDadosAluno()" class="button">
															<span>Salvar</span>
														</a>
													</td>
												</tr>
											</table>
								        </div>
								        <div data-dojo-type="dijit.layout.ContentPane" title="Documentos" id="tabDocumentos">
								            <table style="width:100%;height:100%">
												<tr>
													<td valign="top">
														<table class="formulario">
															<tr>
																<td colspan="8">
														        	<table class="breadorySub" style="width:300px">
																		<tr>
																			<td>5. Digitalização</td>
																		</tr>
																	</table>
																</td>
															</tr>

															<tr>
																<td>
																	<table id="tbDocumentoExameMedico" style="display: none">
																		<tr>
																			<td class="label">- Exame Médico (xerox)</td>
																		</tr>
																	</table>	
																	<table id="tbDocumentoOficio" style="display: none">
																		<tr>
																			<td class="label">- Ofício</td>
																		</tr>
																	</table>
																	<table id="tbDocumentoRgCnh" style="display: none">
																		<tr>
																			<td class="label">- RG</td>
																		</tr>
																		<tr>
																			<td class="label">- CNH</td>
																		</tr>
																	</table>
																	<br>
																	<table>
																		<tr>
																			<td>
																				<div class="fieldset flash" id="fsUploadProgress">
																					<span class="legend">Fila de Envio</span>
																				</div>
																				<div id="divStatus">0 Arquivos Enviados</div>
																				<div>
																					<span id="spanButtonPlaceholder"></span> 
																					<input id="btnUpload" type="button" value="Selecionar" style="width: 75px; height: 29px; font-size: 9pt;" />
																					<input id="btnCancel" type="button" value="Cancelar Todos os Envios" onclick="swfu.cancelQueue();" disabled="disabled" style="margin-left: 2px; font-size: 8pt; height: 29px;" />
																				</div>
																			</td>
																		</tr>
																	</table>																																								
																</td>
															</tr>																							
														</table>
													</td>
												</tr>
												<tr>
													<td align="left">
														<table class="breadory">
															<tr>
																<td>
																	<div id="galleryTop"></div>
																</td>
															</tr>
														</table>
													</td>
												</tr>
											</table>
								        </div>
										<div data-dojo-type="dijit.layout.ContentPane" title="Histórico">
											<table style="width:100%;height:100%">
												<tr>
													<td valign="top">
														<table class="formulario">
															<tr>
																<td colspan="8">
													        		<table class="breadorySub" style="width:300px">
																		<tr>
																			<td>6. Cursos Realizados</td>
																		</tr>
																	</table>
																</td>
															</tr>
															<tr>
																<td>
																	<div id="conteudoHistorico" style="padding-top: -5">
																</td>
															</tr>
														</table>
													</td>
												</tr>
											</table>
								        </div>
								    </div>
								</div>
							</td>
						</tr>
					</table>
				</div>
			</td>
		</tr>
	</table>
	<div id="dialogDetalhe" data-dojo-type="dijit.Dialog" title="Turma - Detalhe">
		<div id="dialogDetalheContent"></div>
		<script language="javascript">
			function atualizaAvaliacao(field, matricula) {
				if(field.value == "")
					return false;
				
				require(["dojo/_base/lang", "dojo/_base/xhr"], function(lang, xhr) {
					xhr.get({
				        url: "cadastroTurma.do?method=atualizarAvaliacao",
				        timeout: ${ajaxTimeoutVoid},
				        content: {
				        	ajax: 'true',
				        	idSelecionado: matricula,
				        	avaliacao: field.value			        	
				        },
				        load: function(data, ioArgs) {

				        },
						error: function(data, ioArgs) {
							showAlertMessage("Erro ao realizar está operação! Tente novamente!");
				        }
				    });
				});
			}		
			function atualizarDetalheTurma() {
				dijit.byId('dialogResultadoProva').hide();
				turmaDetalhe('proximasTurmas');				
			}
			
			function gerarRelacaoAlunosTaxi(codigo) {
				window.open("cadastroTurma.do?method=gerarRelacaoAlunosTaxi&idSelecionado="+codigo);
			}
			
			function gerarCertificados(codigo) {
				window.open("cadastroTurma.do?method=gerarCertificados&idSelecionado="+codigo);
			}
			
			function gerarTermoCredenciamentoTaxi(codigo) {
				window.open("cadastroTurma.do?method=gerarTermoCredenciamentoTaxi&idSelecionado="+codigo);
			}
			
			function turmaDetalhe(codigoTurma) {
				
				require(["dojo/_base/lang", "dojo/_base/xhr"], function(lang, xhr) {
					xhr.post({
				        url: "cadastroTurma.do?method=detalhe",
				        timeout: ${ajaxTimeoutData},
				        handleAs: "text",
				        content: {
				        	ajax: 'true',
				        	idSelecionado:codigoTurma
				        },
				        load: function(data, ioArgs) {
				    		document.getElementById("dialogDetalheContent").innerHTML = data;
				    		dijit.byId('dialogDetalhe').show();
				        },
						error: function(data, ioArgs) {
							showAlertMessage("Erro ao realizar está operação! Tente novamente!");
				        }
				    });
				});
			}
			function detalheCancelar() {
				dijit.byId('dialogDetalhe').hide();
			}
		</script>
	</div>
	</html-el:form>

<script language="javascript">

	var codigoAluno = 0;

	jQuery(function($) {
		$("#cpf").mask("999.999.999/99");
		$("#dataNascimento").mask("99/99/9999");
		$("#orgaoExpeditor").mask("SSP/aa");
		$("#dataPrimeiraHabilitacao").mask("99/99/9999");
		$("#cep").mask("99999-999");
		$("#telefone").mask("(99)9999-9999");
		$("#celular").mask("(99)9999-9999");
		$("#comercial").mask("(99)9999-9999");
		$("#enderecoNumero").forceNumericOnly();
		$("#qtdeServico").forceNumericOnly();
		
		$("#agenciaBanco").forceNumericOnly();
		$("#contaBanco").forceNumericOnly();
		$("#chequeBanco").forceNumericOnly();
		
		$("#pgu").forceNumericOnly();
	});
	
	dojo.addOnLoad(function() {
		verificaCpf();
	});
	
	function verificaCpf() {

		loading();
		require(["dojo/_base/lang", "dojo/_base/xhr"], function(lang, xhr) {
			xhr.post({
		        url: "consultarAluno.do?method=verificaCpf",
		        timeout: ${ajaxTimeoutReturn},
		        handleAs: "json",
		        content: {
		        	ajax: 'true',
		        	cpf:document.getElementById("cpf").value
		        },
		        load: function(data, ioArgs) { 
		        	loadingComplete();
		        	if(data[0] == true) {
			        	document.getElementById("nome").value = data[1];
			        	dijit.byId("dataNascimento").set('value', data[2]);
			        	document.getElementById("sexo").value = data[3];
			        	document.getElementById("deficiente").value = data[4];
			        	document.getElementById("pgu").value = data[5];
			        	document.getElementById("categoria").value = data[6];
			        	dijit.byId("dataPrimeiraHabilitacao").set('value', value = data[7]);
			        	document.getElementById("cep").value = data[8];
			        	document.getElementById("endereco").value = data[9];
			        	document.getElementById("numero").value = data[10];
			        	document.getElementById("complemento").value = data[11];
			        	document.getElementById("bairro").value = data[12];
			        	document.getElementById("cidade").value = data[13];
			        	document.getElementById("uf").value = data[14];
			        	document.getElementById("telefone").value = data[15];
			        	document.getElementById("celular").value = data[16];
			        	document.getElementById("comercial").value = data[17];
			        	document.getElementById("email").value = data[18];
			        	document.getElementById("rg").value = data[19];
			        	document.getElementById("orgaoExpeditor").value = data[20];
			        	codigoAluno = data[21];
			        	initUpload();
			        	viewAllAttaches();
			        	carregarHistorico();
		        	}
		        	document.getElementById("nome").disabled = false;
		        	dijit.byId("dataNascimento").set('disabled', false);
		        	document.getElementById("sexo").disabled = false;
		        	document.getElementById("deficiente").disabled = false;
		        	document.getElementById("pgu").disabled = false;
		        	document.getElementById("categoria").disabled = false;
		        	dijit.byId("dataPrimeiraHabilitacao").set('disabled', false);
		        	document.getElementById("cep").disabled = false;
		        	document.getElementById("endereco").disabled = false;
		        	document.getElementById("numero").disabled = false;
		        	document.getElementById("complemento").disabled = false;
		        	document.getElementById("bairro").disabled = false;
		        	document.getElementById("cidade").disabled = false;
		        	document.getElementById("uf").disabled = false;
		        	document.getElementById("telefone").disabled = false;
		        	document.getElementById("celular").disabled = false;
		        	document.getElementById("comercial").disabled = false;
		        	document.getElementById("email").disabled = false;
		        	document.getElementById("rg").disabled = false;
		        	document.getElementById("orgaoExpeditor").disabled = false;
		        	document.getElementById("nome").focus();		        	
		        },
				error: function(data, ioArgs) {
					showAlertMessage("Erro ao realizar está operação! Tente novamente!");
		        }
		    });
		});		
	}
	
	function consultaCep(field) {
		
		if(field.value == "") {
			return;
		}
		loading();
		require(["dojo/_base/lang", "dojo/_base/xhr"], function(lang, xhr) {
			xhr.get({
		        url: "cep.do?method=consultaCep",
		        timeout: ${ajaxTimeoutReturn},
		        content: {
		        	ajax: 'true',
		        	cep:field.value
		        },
		        load: function(data, ioArgs) {
		        	loadingComplete();
		        	eval(data);
		        	if(unescape(resultadoCEP['resultado']) == "1") {
						document.getElementById("endereco").value = unescape(resultadoCEP['tipo_logradouro']) + " " + unescape(resultadoCEP['logradouro']);
						document.getElementById("cidade").value = unescape(resultadoCEP['cidade']);
						document.getElementById("bairro").value = unescape(resultadoCEP['bairro']);
						document.getElementById("uf").value = unescape(resultadoCEP['uf']);
						document.getElementById("numero").focus();
		        	} else {
		        		alert(unescape(resultadoCEP['resultado_txt']));
						document.getElementById("endereco").value = "";
						document.getElementById("numero").value = "";
						document.getElementById("complemento").value = "";
						document.getElementById("cidade").value = "";
						document.getElementById("bairro").value = "";
						document.getElementById("uf").value = "SP";
						field.focus();
		        	}
		        },
				error: function(data, ioArgs) {
					showAlertMessage("Erro ao realizar está operação! Tente novamente!");
		        }
		    });
		});
	}
	
	function manterDadosAluno() {
		
		if(!mandatoryField('cpf')) {
			return;
		}
		
		if(!validateCPF(document.getElementById("cpf")))
			return;
		
		if(!mandatoryField('nome')) {
			return;
		}
		if(!mandatoryField('dataNascimento')) {
			return;
		}
		if(!mandatoryField('rg')) {
			return;
		}
		if(!mandatoryField('orgaoExpeditor')) {
			return;
		}
		if(document.getElementById("orgaoExpeditor").value.length != 6) {
			alert("Orgão Expeditor inválido! O campo deve ter 5 caracteres.");
			return;
		}
		if(!mandatoryField('sexo')) {
			return;
		}		
		if(!mandatoryField('deficiente')) {
			return;
		}
		if(!mandatoryField('cep')) {
			return;
		}
		if(!mandatoryField('endereco')) {
			return;
		}
		if(!mandatoryField('numero')) {
			return;
		}		
		if(!mandatoryField('bairro')) {
			return;
		}
		if(!mandatoryField('cidade')) {
			return;
		}
		if(!mandatoryField('uf')) {
			return;
		}
			
		require(["dojo/_base/lang", "dojo/_base/xhr"], function(lang, xhr) {
			xhr.post({
		        url: "matricularAluno.do?method=manterDadosAluno",
		        timeout: ${ajaxTimeoutVoid},
		        handleAs: "json",
		        content: {
		        	ajax: 'true',
		        	codigo:codigoAluno,
		        	cpf: document.getElementById("cpf").value,
		        	nome: document.getElementById("nome").value,
		        	dataNascimento: document.getElementById("dataNascimento").value,
		        	rg: document.getElementById("rg").value,
		        	orgaoExpeditor: document.getElementById("orgaoExpeditor").value,
		        	sexo: document.getElementById("sexo").value,
		        	deficiente: document.getElementById("deficiente").value,
		        	pgu: document.getElementById("pgu").value,
		        	categoria: document.getElementById("categoria").value,
		        	dataPrimeiraHabilitacao: document.getElementById("dataPrimeiraHabilitacao").value,
		        	cep: document.getElementById("cep").value,
		        	endereco: document.getElementById("endereco").value,
		        	numero: document.getElementById("numero").value,
		        	complemento: document.getElementById("complemento").value,
		        	bairro: document.getElementById("bairro").value,
		        	cidade: document.getElementById("cidade").value,
		        	uf: document.getElementById("uf").value,
		        	telefone: document.getElementById("telefone").value,
		        	celular: document.getElementById("celular").value,
		        	comercial: document.getElementById("comercial").value,
		        	email: document.getElementById("email").value
		        },
		        load: function(data) {
		        	codigoAluno = data[0];
		    		dijit.byId('tabContainer').selectChild('tabDocumentos');
		        	initUpload();
		        },
				error: function(data, ioArgs) {
					showAlertMessage("Erro ao realizar está operação! Tente novamente!");
		        }
		    });
		});
	}
	
	var swfu;
	function initUpload() {
		
		var settings = {
			flash_url : "_scripts/jquery-1.7.1/swfupload/swfupload.swf",
			upload_url: "anexoAluno?action=upload&usuario=${usuario.codigo}&aluno="+codigoAluno,
			file_size_limit : "1 MB",
			file_types : "*.*",
			file_types_description : "Todos os arquivos",
			file_upload_limit : 100,
			file_queue_limit : 0,
			custom_settings : {
				progressTarget : "fsUploadProgress",
				cancelButtonId : "btnCancel"
			},
			debug: false,

			// Button settings
			button_placeholder_id : "spanButtonPlaceholder",
			button_width: 61,
			button_height: 22,
			button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
			button_cursor: SWFUpload.CURSOR.HAND,
			
			// The event handler functions are defined in handlers.js
			file_queued_handler : fileQueued,
			file_queue_error_handler : fileQueueError,
			file_dialog_complete_handler : fileDialogComplete,
			upload_start_handler : uploadStart,
			upload_progress_handler : uploadProgress,
			upload_error_handler : uploadError,
			upload_success_handler : uploadSuccess,
			upload_complete_handler : uploadComplete,
			queue_complete_handler : queueComplete,	// Queue plugin event
			
			// SWFObject settings
			minimum_flash_version : "9.0.28",
			swfupload_pre_load_handler : swfUploadPreLoad,
			swfupload_load_failed_handler : swfUploadLoadFailed
		};

		swfu = new SWFUpload(settings);
	}
	
	function uploadSuccess(file, serverData) {
		try {
			var progress = new FileProgress(file, this.customSettings.progressTarget);
			progress.setComplete();
			progress.setStatus("Complete.");
			progress.toggleCancel(false);

			document.getElementById("galleryTop").innerHTML = serverData;
			$('#gallery a').lightBox();	
		} catch (ex) {
			this.debug(ex);
		}
	}
	
	function viewAllAttaches() {
		require(["dojo/_base/lang", "dojo/_base/xhr"], function(lang, xhr) {
			xhr.get({
		        url: "anexoAluno",
		        timeout: ${ajaxTimeoutData},
		        content: {
		        	ajax: 'true',
		        	action: "render",
		        	aluno: codigoAluno
		        },
		        load: function(data, ioArgs) {
					document.getElementById("galleryTop").innerHTML = data;
					$('#gallery a').lightBox();	
		        },
				error: function(data, ioArgs) {
					showAlertMessage("Erro ao realizar está operação! Tente novamente!");
		        }
		    });
		});
	}
	
	function carregarHistorico() {
		require(["dojo/_base/lang", "dojo/_base/xhr"], function(lang, xhr) {
			xhr.get({
		        url: "consultarAluno.do?method=carregarHistorico",
		        timeout: ${ajaxTimeoutData},
		        content: {
		        	ajax: 'true',
		        	aluno: codigoAluno
		        },
		        load: function(data, ioArgs) {
					document.getElementById("conteudoHistorico").innerHTML = data;
		        },
				error: function(data, ioArgs) {
					showAlertMessage("Erro ao realizar está operação! Tente novamente!");
		        }
		    });
		});
	}	
	
	function excluirAnexo(codigo) {
		require(["dojo/_base/lang", "dojo/_base/xhr"], function(lang, xhr) {
			xhr.get({
		        url: "anexoAluno",
		        timeout: ${ajaxTimeoutData},
		        content: {
		        	ajax: 'true',
		        	action: "delete",
		        	aluno: codigoAluno,
		        	id: codigo
		        },
		        load: function(data, ioArgs) {
					document.getElementById("galleryTop").innerHTML = data;
					$('#gallery a').lightBox();	
		        },
				error: function(data, ioArgs) {
					showAlertMessage("Erro ao realizar está operação! Tente novamente!");
		        }
		    });
		});		
	}
	
	function certificado(codigoMatricula) {
		window.open("cadastroTurma.do?method=gerarCertificados&matricula=" + codigoMatricula);
	}
	function comprovante(codigoMatricula) {
		window.open("consultarAluno.do?method=comprovante&matricula=" + codigoMatricula);
	}
	
</script>